#! /bin/bash
while true
do
    read -p "please enter your numbr: " numbr
    expr $numbr + 1 &> /dev/null
    if [ $? -eq 0 ]; then
        if [ `expr $numbr \> 0` -eq 1 ]; then
            for((i = 0; i < numbr; i++))
            do
                sum=`expr $sum + $i`
            done
            echo "1+2+3+4+5+6+....+$numbr = $sum"
            exit
        fi
    fi
    echo  "input is err, please try again"
    continue
done